﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UFIDA.U8.Portal.Proxy.supports;
using UFIDA.U8.Portal.Proxy.editors;
using UFSoft.U8.Framework.Login.UI;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using Globalization.SystemSet;
using UFSoft.U8.Framework.LoginContext;

namespace LKU8.shoukuan
{
    public class xialiaologin : NetLoginable
    {
        //U8EnvContext envContext = new U8EnvContext();
        public override object CallFunction(string cMenuId, string cMenuName, string cAuthId, string cCmdLine)
        {

            CanShu.userName = LoginObject.GetLoginInfo().UserName;
            string userToken = LoginObject.userToken;
            CanShu.acc = LoginObject.GetLoginInfo().AccID;



            U8Login.clsLogin u8Login = new U8Login.clsLogin();
            u8Login.ConstructLogin(userToken);
            ////u8Login.UfDbPath = ztdb;
            CanShu.conStr = u8Login.UFDataConnstringForNet;
            CanShu.u8Login = u8Login;
            CanShu.cLanguageID = LoginObject.GetLoginInfo().LanguageID;
            //if (CanShu.cLanguageID == "en-US")
            //{
            //    SystemConfig.SysLanguageTypeE = SystemConfig.LanguageTypeEnum.en_US;
            //}
            //else
            //{
            //    SystemConfig.SysLanguageTypeE = SystemConfig.LanguageTypeEnum.zh_CH;
            //}


            CanShu.isAdmin = CanShu.u8Login.IsAdmin;
              


            //当前菜单控制权限
             CanShu.authControl =true;
             //MessageBox.Show(canshu.conStr);
            INetUserControl mycontrol = new MENU_WanJi_SCJH_Import();
            mycontrol.Title = cMenuName;
            CanShu.cMenuname = "\\" + cMenuName + "layout.xml";
            base.ShowEmbedControl(mycontrol, cMenuId, true);

            

            return null;
        }
        public override bool SubSysLogin()
        {
            
            return true;
        }


    }
}
